use crate::{
    enter_syscall,
    syscall::{SYS_EXECVE, SYS_EXIT, SYS_GETPID, SYS_WAIT4},
};

pub fn exit(code: usize) {
    enter_syscall(code, 0, 0, 0, 0, 0, SYS_EXIT);
}

pub fn waitpid(pid: usize) {
    enter_syscall(pid, 0, 0, 0, 0, 0, SYS_WAIT4);
}

pub fn getpid() -> usize {
    enter_syscall(0, 0, 0, 0, 0, 0, SYS_GETPID)
}

pub fn execve(path: *const i8, argv: *const *mut i8, envp: *const *mut i8) {
    enter_syscall(
        path as usize,
        argv as usize,
        envp as usize,
        0,
        0,
        0,
        SYS_EXECVE,
    );
}
